import { defineConfig } from "vite";
import path from "path";
import { crx } from "@crxjs/vite-plugin";
import vue from "@vitejs/plugin-vue";
import manifest from "./manifest";
import { resolve } from "path";

export default defineConfig({
  plugins: [crx({ manifest }), vue()],
  resolve: {
    alias: {
      "@view": path.resolve(__dirname, "view"),
    },
  },
  build: {
    rollupOptions: {
      input: {
        popup: resolve(__dirname, "view/popup/index.html"),
        index: resolve(__dirname, "view/newtab/index.html"),
      },
    },
  },
});
